<pre>
Starting
<?php
$x = "14+2.2*-3";
echo "Deconstructing $x \n";
// go through item by item to pick up unary minus
$num = "";
$sym = "";
$prec = '*/-+';
$numstack = array("0");
$symstack = array();
$cumval = "";
$lastc = "";
for ($i=0;$i<strlen($x);$i++) {
 $c = $x[$i];
 if ($c == "-" && $lastc <> "" || strpos("0123456789.",$c)) {
  $num = $num.$c;
  $lastc = "";
 } else {
  if ($num <> "") {
   $numstack[] = $num;
   $num = "";
  }
  $symstack[] = $c;
 }
 $lastc = $c;
// echo $c."\n";
}
$numstack[] = $num;
$symstack[] = $sym;
print_r($numstack);
print_r($symstack);
?>

Ending